<?php
/**
 * 优惠券
 * User: eecjimmy
 * Date: 2015/6/23
 * Time: 22:49
 */

namespace Wap\Controller;


class CouponController extends WapController{
    // 优惠券列表
    function index(){
        require_once __DIR__ . "/jssdk.php";
        $jssdk = new JSSDK("wx331ed6d859b117cb", "dbada5df9c35c886582d7a0d05fe3a2c");
        $wxConfig = $jssdk->getSignPackage();

        

        require_once __DIR__ . "/cardConfig.php";

        $cardsdk = new CARDSDK("wx331ed6d859b117cb", "dbada5df9c35c886582d7a0d05fe3a2c");
        $cardConfig = $cardsdk->getSignPackage();




        //p6F-qjobFwffgaSS21p30pJQ6G3Y  测试一个临时卡卷领取配置
        $tcard[] = $cardConfig['timestamp'];
        $tcard[] = $cardConfig['nonceStr'];
        $tcard[] = $cardsdk->getApiTicket();
        $tcard[] = 'p6F-qjobFwffgaSS21p30pJQ6G3Y';

        sort($tcard,SORT_STRING);

        $getCard['signature'] = sha1( implode($tcard));
        $getCard['nonce_str'] = $cardConfig['nonceStr'];
        $getCard['timestamp'] = $cardConfig['timestamp'];

        $getCard['card_id'] = 'p6F-qjobFwffgaSS21p30pJQ6G3Y';

        $this->assign('getCard',$getCard);



        $this->assign('wxConfig', $wxConfig);

        $this->assign('cardConfig',$cardConfig);

        $this->display();
    }



    // 已使用优惠券
    function used(){
        $this->display();
    }

    // 未使用优惠券
    function un_used(){
        $this->display();
    }

    // 优惠券详情
    function detail(){
        $this->display();
    }




}